import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import Chird1 from './Chird1'
import Chird2 from './Chird2'
import Chird3 from './Chird3'

export default class ParentComponent extends React.Component {

  state={
    count:0,
  }

  render() {
    console.log('ParentComponent render',this.state.count);
    return (
      <View>
        <TouchableOpacity
          onPress={() => {
            const count = this.state.count+1;
            this.setState({
              count:count
            })
          }}>
          <Text>一级页面</Text>
          <Text>ParentComponent</Text>
        </TouchableOpacity>

        <Chird1/>
        <Chird2/>
        <Chird3/>
      </View>
    )
  }
}
